package cn.siat.gene.controller;

import cn.siat.common.core.web.controller.BaseController;
import cn.siat.common.core.web.domain.AjaxResult;
import cn.siat.common.security.annotation.RequiresPermissions;
import cn.siat.gene.domain.Logs;
import cn.siat.gene.service.LogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 日志Controller
 * 
 * @author siat
 * @date 2022-10-08
 */
@RestController
@RequestMapping("/logs")
public class LogsController extends BaseController
{
    @Autowired
    private LogsService logsService;

    /**
     * 查询日志列表
     */
    @GetMapping("/{projectId}")
    @RequiresPermissions("gene-project:project:log")
    public AjaxResult listLogs(@PathVariable String projectId)
    {
        List<Logs> list = logsService.selectLogsList(projectId);
        return AjaxResult.success(list);
    }

    /**
     * 导出日志列表
     *//*
    @Log(title = "日志", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DesignTPLogs designTPLogs)
    {
        List<DesignTPLogs> list = designTPLogsService.selectDesignTPLogsList(designTPLogs);
        ExcelUtil<DesignTPLogs> util = new ExcelUtil<DesignTPLogs>(DesignTPLogs.class);
        util.exportExcel(response, list, "日志数据");
    }*/

}
